<?php 
namespace Modules\ShopApi\Http\Controllers\v1;
use Illuminate\Http\Request;
use Modules\ShopApi\Http\Requests\CommonIdRequest;
use Modules\ShopApi\Models\ShopUser as ShopUserModel;
use Modules\ShopApi\Models\ShopProductFootprint as ShopProductFootprintModel;
use Modules\ShopApi\Models\ShopProductCollection as ShopProductCollectionModel;
use Modules\ShopApi\Models\ShopVisit as ShopVisitModel;
use Modules\ShopApi\Models\AuthConfig as AuthConfigModel;
class AuthController extends CommonController
{
	/**
	 * @name  小程序登录
	 * @method  POST	
	 * @param  code string 微信code码	
	 * @param  encryptData string encryptData	
	 * @param  iv string iv		
	 * @return  JSON
	 */
    public function login(Request $request)
    {
		return (new ShopUserModel())->login($request->all());
    }
	/**	 
	 * @name  获取用户信息
	 * @method  GET	
	 * @return  JSON	 
	 */
    public function my(Request $request)
    {
		return (new ShopUserModel())->my();
    }
	/**	 
	 * @name  获取设置信息
	 * @method  GET	
     * @return  JSON	 
	 */
    public function set(Request $request)
    {
		return (new ShopUserModel())->set();
    }
	/**	 
	 * @name  刷新token
	 * @method  PUT		
	 * @return  JSON
	 */
    public function refresh()
    {
        return (new ShopUserModel())->refresh();
    }
	/**
	 * @name  绑定手机号
	 * @method  PUT	
	 * @param  code string 微信code码	
	 * @param  encryptData string encryptData	
	 * @param  iv string iv		
	 * @return  JSON
	 */
    public function send_phone(Request $request)
    {
		return (new ShopUserModel())->send_phone($request->all());
    }
	/**	 
	 * @name  退出登录
	 * @method  DELETE	
	 * @return  JSON
	 */
    public function logout()
    {
		return (new ShopUserModel())->logout();
    }
	/**	 
	 * @name  商品足迹
	 * @method  GET	
	 * @param  page int 页码
     * @return  JSON	 
	 */
    public function get_footprint(Request $request)
    {
		return (new ShopProductFootprintModel())->get_footprint();
    }
	/**	 
	 * @name  收藏商品
	 * @method  GET	
	 * @param  page int 页码
     * @return  JSON	 
	 */
    public function get_collection(Request $request)
    {
		return (new ShopProductCollectionModel())->get_collection();
    }	
	/**	 
	 * @name  前台访问
	 * @method  GET	
     * @return  JSON	 
	 */
    public function set_visit()
    {
		return (new ShopVisitModel())->set_visit();
    }
	/**	 
	 * @name  关于我们
	 * @method  GET	
     * @return  JSON	 
	 */
    public function get_about_us()
    {
		return (new AuthConfigModel())->get_about_us();
    }	
		
}
